package file;

import java.io.File;
import java.io.FileFilter;

public class Test1 {
    public static void main(String[] args) {
        File file = new File("./src/main/java/file");
        if (file.isDirectory()){
            FileFilter filter = new FileFilter() {
                @Override
                public boolean accept(File pathname) {
                    String name = pathname.getName();
                    return name.startsWith("D");
                }
            };
                File[] subs = file.listFiles();
            for (File f : subs) {
                System.out.println(f.getName());
            }
        }
    }
}
